import React from 'react';
import { TouchableOpacity, Image, StyleSheet } from 'react-native';

const CustomBackButton = ({ onPress }) => {
  return (
    <TouchableOpacity onPress={onPress} style={styles.button} accessibilityLabel="返回">
      <Image source={require('../../res/image/navi_back.png')} style={styles.image} />
    </TouchableOpacity>
  );
};

const styles = StyleSheet.create({
  button: {
    padding: 10,
    justifyContent: 'center',
    alignItems: 'center',
  },
  image: {
    width: 25,
    height: 25,
    resizeMode: 'contain', // 确保图片按比例缩放
  },
});

export default CustomBackButton;
